package com.lianbang.pharmacy.model

import cn.ubest.mvvmcore.base.BaseModel
import cn.ubest.mvvmcore.bean.ListDataWrapper
import cn.ubest.mvvmcore.bean.ListWrapper
import cn.ubest.mvvmcore.bean.ResultWrapper
import com.lianbang.pharmacy.bean.*
import com.lianbang.pharmacy.http.api.MedicineApi


class MedicineModel : BaseModel() {
    private val c = MedicineApi::class.java

    suspend fun supplierList(): ListWrapper<SupplierListBean> {
        return createService(c).supplierList()
    }

    suspend fun searchMedicine(word: String, news: Int): ListWrapper<MedicineListBean> {
        return createService(c).searchMedicine(word, news)
    }


    suspend fun medicineInfo(id: Int): ResultWrapper<MedicineInfoBean> {
        return createService(c).medicineInfo(id)

    }

    suspend fun medicineSupplierList(id: Int): ListWrapper<MedicineSupplierListBean> {
        return createService(c).medicineSupplierList(id)
    }

    suspend fun medicineCategoryList(): ListDataWrapper<MedicineCategoryListBean> {
        return createService(c).medicineCategoryList()
    }

}
